function addField(tipo){
	$.post(baseUrl+"/forms/add_field/"+tipo, function(data) {
		  $('#content_edit').html(data); //recarrega o form
	});
}

function removeField(id){
	$.post(baseUrl+"/forms/remove_field/"+id, function(data) {
		  $('#content_edit').html(data); //recarrega o form
		  $('#myTab li:eq(0) a').tab('show');
	});
}

function editField(id){
	selectField("#control-"+id);
	$.post(baseUrl+"/forms/edit_field/"+id, function(data) {
		  $('#tab-field-prop').html(data); //inner html do conteudo da aba
		  $('#myTab li:eq(1) a').tab('show'); //selecionar segunda aba
	});
}

function selectField(id){
	$(".form-field-new").removeClass("form-field-new-selected");
	$(id).addClass("form-field-new-selected");
}
